{% set pypi_name = 'monasca-statsd' %}
{% set upstream_version = upstream_version('2.1.0') %}
{% set rpm_release = '1' %}

Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Python Statsd library for sending statsd messages via the Monasca Agent
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://wiki.openstack.org/wiki/Monasca
Source0:        https://files.pythonhosted.org/packages/source/m/{{ pypi_name }}/{{ pypi_name }}-%{version}.tar.gz
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('six') }}
BuildRequires:  {{ py3('stestr') }}
BuildArch:      noarch

%description
Python Statsd library for sending statsd messages via the Monasca Agent

%package -n python3-monasca-statsd
Summary:        Python Statsd library for sending statsd messages via the Monasca Agent
Requires:       {{ py3('six') }}

%description -n python3-monasca-statsd
Python Statsd library for sending statsd messages via the Monasca Agent

This package contains the Python 3.x module.

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup

%build
export LC_ALL=en_US.utf-8
%{py3_build}

%install
export LC_ALL=en_US.utf-8
%{py3_install}

%check
export LC_ALL=en_US.utf-8
python3 -m stestr.cli run

%files -n python3-monasca-statsd
%license LICENSE
%doc README.rst ChangeLog
%{python3_sitelib}/monascastatsd
%{python3_sitelib}/*.egg-info

%changelog
